package com.yuqian.JavaSe.leetcode.easy;

public class PowerofFour {
	 public static boolean isPowerOfFour(int num) {
		   if(num==0){
	        	return false;
	        }
	        int k=1;
	        while(k!=num){
	        	if(k<num){
	        		if(k*4<Integer.MAX_VALUE){
	        			k=k*4;
	        		}else{
	        			return false;
	        		}
	        	}else{
	        		return false;
	        	}
	        }
	        return true;
	    }
	 
	 public static void main(String[] args) {
		 System.out.println(isPowerOfFour(8));
	}
}
